//
// Created by blank on 2017/5/8.
// Copyright (c) 2017 CYN. All rights reserved.
//

#import "ServiceFactory.h"
#import "PrintService.h"


@implementation ServiceFactory {

}

+ (ServiceFactory *)instance {
    static ServiceFactory *_instance = nil;

    @synchronized (self) {
        if (_instance == nil) {
            _instance = [[self alloc] init];
        }
    }

    return _instance;
}

- (instancetype)init {
    self = [super init];
    if (self) {
        [self printService];
    }

    return self;
}

- (PrintService *)printService {
    if (!_printService) {
        _printService = [[PrintService alloc] init];
    }
    return _printService;
}


@end